/*
 +----------------------------------------------------------------------
 + Title        : chatTarget
 + Author       : huwl
 + Version      : 1.0.0
 + Initial-Time : 2023-03-11
 + Last-time    : 这个文件最后修改的时间 + 修改人的名称
 + Desc         : 聊天对象接口
 +----------------------------------------------------------------------
*/

import type { AddChatTargetParams, ChatTargetListParams, ChatTargetListResult } from '@/types/chatTarget'
import type { ApiResponse } from '@/types/global'
import request from '@/utils/httpRequest'

/**
 * 新增,请求方式[POST]
 * 
 * @param AddChatTargetParams data -----------------------------请求参数
 * @returns <any, ApiResponse<any>>
 * @author huwl
 */
export const reqAddChatTargetAPI = (data: AddChatTargetParams) => {
    return request<any, ApiResponse<any>>({
        method: 'POST',
        url: 'chatTarget/add',
        data
    })
}

/**
 * 删除,请求方式[GET]
 * 
 * @param number friend_id -------------------------------------请求参数
 * @returns <any, ApiResponse<any>>
 * @author huwl
 */
export const reqDeleteChatTargetAPI = (ids: string) => {
    return request<any, ApiResponse<any>>({
        method: 'GET',
        url: 'chatTarget/delete',
        params: {ids}
    })
}

/**
 * 列表,请求方式[GET]
 * 
 * @param ChatTargetListParams params --------------------------请求参数
 * @returns <any, ApiResponse<FriendListResult>>
 * @author huwl
 */
export const reqChatTargetListAPI = (params: ChatTargetListParams) => {
    return request<any, ApiResponse<ChatTargetListResult>>({
        method: 'GET',
        url: 'chatTarget/list',
        params
    })
}